package com.tc.controller;

import com.tc.R;
import com.tc.entity.Order_Commodity;
import com.tc.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: wangyifan
 * @Date: 2022/03/01 10:53
 * @Description: $end$
 * @Version: V1.0
 */
@RestController
@RequestMapping("/tc")
public class GoodsController {

    @Autowired(required = false)
    private GoodsService goodsService;

    /**订单确定后，减少商品库存*/
    @GetMapping("/reduceGoods")
    public R reduceGoods(@RequestParam("goodsId") Long goodsId,@RequestParam("goodsNumber") Integer goodsNumber){

        R r = goodsService.reduceGoods(goodsId,goodsNumber);

        return r;
    }
}
